package com.wxw.gulidemo.controller;/**
 * @author by xxz
 * @date 2022/5/31
 */


import com.wxw.gulidemo.R;
import com.wxw.gulidemo.service.OssService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

/**
 * @Description

 * @author by xxz

 * @date 2022/5/31

 * @throws
 */
@Api(value = "阿里云文件管理")
@RestController
@CrossOrigin
@RequestMapping("/edu_oss/fileoss")
public class OssController {

    @Autowired
    private OssService ossService;

    @PostMapping("/fileupload")
    public R fileupload(@RequestParam(value = "file") MultipartFile file){
        String url = ossService.uploadFileAvatar(file);
        return R.ok().data("url",url).message("文件上传成功");
    }

}
